/* 重置和基础样式 */
:root {
    --primary-color: #00f7ff;
    --secondary-color: #0a4d68;
    --background-color: #001219;
    --surface-color: #0a2332;
    --text-color: #e0f7ff;
    --accent-color: #00ff9d;
    --error-color: #ff4757;
    --success-color: #2ed573;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rajdhani', 'Orbitron', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* 容器样式 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* 导航链接 */
.nav-links {
    display: flex;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.nav-links::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    animation: scan 3s linear infinite;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    padding: 8px 20px;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    background: var(--surface-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-links a:hover {
    background: var(--primary-color);
    color: var(--background-color);
    box-shadow: 0 0 15px var(--primary-color);
}

/* 图片容器 */
.image-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 400px;
    margin: 30px auto;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-color);
    box-shadow: 0 0 20px rgba(0, 247, 255, 0.2);
}

.image-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    animation: borderGlow 2s linear infinite;
    pointer-events: none;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

/* 计时器 */
.timer {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--surface-color);
    color: var(--primary-color);
    padding: 10px 20px;
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    font-size: 1.5rem;
    font-family: 'Orbitron', sans-serif;
    box-shadow: 0 0 10px var(--primary-color);
    z-index: 10;
}

/* 操作按钮容器 */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px auto;
    max-width: 260px;
}

/* 看涨看跌按钮基础样式 */
.controls .btn {
    width: 90px;
    height: 36px;
    padding: 0;
    font-size: 0.9rem;
    font-family: 'Orbitron', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--primary-color);
    background: var(--surface-color);
    color: var(--text-color);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    border-radius: 4px;
}

/* 按钮发光边框效果 */
.controls .btn::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 4px;
    background: linear-gradient(45deg, 
        var(--primary-color), 
        transparent 40%,
        transparent 60%,
        var(--primary-color)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 按钮悬停效果 */
.controls .btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 0 15px rgba(0, 247, 255, 0.2);
}

.controls .btn:hover:not(:disabled)::before {
    opacity: 0.5;
}

/* 看涨按钮特殊样式 */
.controls .btn-up {
    border-color: var(--primary-color);
}

.controls .btn-up:hover:not(:disabled) {
    color: var(--primary-color);
}

/* 看跌按钮特殊样式 */
.controls .btn-down {
    border-color: var(--primary-color);
}

.controls .btn-down:hover:not(:disabled) {
    color: var(--primary-color);
}

/* 按钮激活效果 */
.controls .btn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 0 10px rgba(0, 247, 255, 0.1);
}

/* 按钮禁用状态 */
.controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 按钮内部扫描线动画 */
.controls .btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(0, 247, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    animation: scanLine 2s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.controls .btn:hover:not(:disabled)::after {
    opacity: 1;
}

/* 扫描线动画 */
@keyframes scanLine {
    0% {
        transform: translate(-50%, -50%) rotate(45deg);
    }
    100% {
        transform: translate(50%, 50%) rotate(45deg);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .controls {
        gap: 15px;
        max-width: 220px;
    }

    .controls .btn {
        width: 80px;
        height: 32px;
        font-size: 0.85rem;
    }
}

/* 统计容器 */
.stats-container {
    background: var(--surface-color);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--primary-color);
    margin: 20px auto;
    max-width: 400px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stats-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(0, 247, 255, 0.1),
        transparent
    );
    animation: rotate 10s linear infinite;
}

/* 加载动画 */
.image-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 3px solid var(--surface-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 结果显示容器 */
.result-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    background: rgba(10, 35, 50, 0.95);
    padding: 15px 30px;
    border-radius: 6px;
    text-align: center;
    backdrop-filter: blur(5px);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 247, 255, 0.3);
    animation: fadeIn 0.3s ease-out;
    min-width: 200px;
    max-width: 80%;
}

.result-container .result-text {
    font-size: 1.4rem;
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.result-container .correct-answer {
    font-size: 1rem;
    opacity: 0.9;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
}

.result-container.success {
    border-color: var(--success-color);
    box-shadow: 0 0 15px rgba(46, 213, 115, 0.2);
}

.result-container.success .result-text {
    color: var(--success-color);
}

.result-container.error {
    border-color: var(--error-color);
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.2);
}

.result-container.error .result-text {
    color: var(--error-color);
}

/* 添加淡入淡出动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
}

/* 动画 */
@keyframes scan {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes borderGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 状态提示 */
.status {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 0.9rem;
    z-index: 1000;
    background: var(--surface-color);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 247, 255, 0.3);
}

.status.success {
    border-color: var(--success-color);
    color: var(--success-color);
}

.status.error {
    border-color: var(--error-color);
    color: var(--error-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .image-container {
        height: 300px;
    }

    .controls {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }

    .nav-links {
        flex-wrap: wrap;
    }

    .nav-links a {
        flex: 1;
        text-align: center;
    }

    .result-container {
        padding: 12px 25px;
    }

    .result-container .result-text {
        font-size: 1.2rem;
    }

    .result-container .correct-answer {
        font-size: 0.9rem;
    }
}

/* 导航按钮容器 */
.nav-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px auto;
    max-width: 300px; /* 限制器最大宽度 */
}

/* 导航按钮样式 */
.nav-buttons .btn {
    padding: 8px 20px;
    min-width: 100px;
    font-size: 0.9rem;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 上一题按钮特殊样式 */
.nav-buttons .btn-secondary {
    background: var(--surface-color);
    border: 1px solid var(--secondary-color);
    color: var(--text-color);
}

.nav-buttons .btn-secondary:hover:not(:disabled) {
    background: var(--secondary-color);
    box-shadow: 0 0 15px var(--secondary-color);
}

/* 下一题按钮特殊样式 */
.nav-buttons .btn-primary {
    background: var(--surface-color);
    border: 1px solid var(--primary-color);
}

/* 禁用状态样式 */
.nav-buttons .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    background: var(--surface-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-buttons {
        gap: 10px;
        max-width: 250px;
    }

    .nav-buttons .btn {
        padding: 6px 15px;
        min-width: 90px;
        font-size: 0.85rem;
    }
}